﻿using Prism.Mvvm;

namespace IntoStationSystem.Models
{
    public class RfidModel : BindableBase
    {
        //new
        bool readSuccess;
        bool writeSuccess;
        bool tellToRead;
        bool tellToWrite;
        bool forceWrite;
        int curProductModel;
        int curWorkstation;

        public bool ReadSuccess
        {
            get => readSuccess; set => SetProperty(ref readSuccess, value);
        }
        public bool WriteSuccess
        {
            get => writeSuccess; set => SetProperty(ref writeSuccess, value);
        }
        public bool TellToRead
        {
            get => tellToRead; set => SetProperty(ref tellToRead, value);
        }
        public bool TellToWrite
        {
            get => tellToWrite; set => SetProperty(ref tellToWrite, value);
        }
        public bool ForceWrite
        {
            get => forceWrite; set => SetProperty(ref forceWrite, value);
        }
        public int CurProductModel
        {
            get => curProductModel; set => SetProperty(ref curProductModel, value);
        }

        public int CurWorkstation
        {
            get => curWorkstation; set => SetProperty(ref curWorkstation, value);
        }
        //old
        int currentMode;
        int currentStatus;
        int trayNum;
        int workstation;
        bool write;
        bool read;
        string rfidData;
        string productID;

        public string RfidData
        {
            get => rfidData; set => SetProperty(ref rfidData, value);
        }

        public string ProductID
        {
            get => productID; set => SetProperty(ref productID, value);
        }

        public int CurrentMode
        {
            get => currentMode; set => SetProperty(ref currentMode, value);
        }
        public int CurrentStatus
        {
            get => currentStatus; set => SetProperty(ref currentStatus, value);
        }
        public int TrayNum
        {
            get => trayNum; set => SetProperty(ref trayNum, value);
        }
        public int Workstation
        {
            get => workstation; set => SetProperty(ref workstation, value);
        }
        public bool Write
        {
            get => write; set => SetProperty(ref write, value);
        }
        public bool Read
        {
            get => read; set => SetProperty(ref read, value);
        }
        public bool IsRead { get; set; }

        public byte[] WriteDatas = new byte[32];
        public byte[] ReadDatas = new byte[32];

        int readMode;
        int readResult;
        int readWorkstation;
        int readID1;
        int readID2;
        int readID3;
        int readID4;
        int readID5;
        int readID6;
        int writeMode;
        int writeResult;
        int writeWorkstation;
        int writeID1;
        int writeID2;
        int writeID3;
        int writeID4;
        int writeID5;
        int writeID6;

        public int ReadMode
        {
            get => readMode; set => SetProperty(ref readMode, value);
        }
        public int ReadResult
        {
            get => readResult; set => SetProperty(ref readResult, value);
        }
        public int ReadWorkstation
        {
            get => readWorkstation; set => SetProperty(ref readWorkstation, value);
        }
        public int ReadID1
        {
            get => readID1; set => SetProperty(ref readID1, value);
        }
        public int ReadID2
        {
            get => readID2; set => SetProperty(ref readID2, value);
        }
        public int ReadID3
        {
            get => readID3; set => SetProperty(ref readID3, value);
        }
        public int ReadID4
        {
            get => readID4; set => SetProperty(ref readID4, value);
        }
        public int ReadID5
        {
            get => readID5; set => SetProperty(ref readID5, value);
        }
        public int ReadID6
        {
            get => readID6; set => SetProperty(ref readID6, value);
        }
        public int WriteMode
        {
            get => writeMode; set => SetProperty(ref writeMode, value);
        }
        public int WriteResult
        {
            get => writeResult; set => SetProperty(ref writeResult, value);
        }
        public int WriteWorkstation
        {
            get => writeWorkstation; set => SetProperty(ref writeWorkstation, value);
        }
        public int WriteID1
        {
            get => writeID1; set => SetProperty(ref writeID1, value);
        }
        public int WriteID2
        {
            get => writeID2; set => SetProperty(ref writeID2, value);
        }
        public int WriteID3
        {
            get => writeID3; set => SetProperty(ref writeID3, value);
        }
        public int WriteID4
        {
            get => writeID4; set => SetProperty(ref writeID4, value);
        }
        public int WriteID5
        {
            get => writeID5; set => SetProperty(ref writeID5, value);
        }
        public int WriteID6
        {
            get => writeID6; set => SetProperty(ref writeID6, value);
        }
    }
}
